﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Interface;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class MonHocTuongDuongRepository:IMonHocTuongDuongRepository
    {

        #region property
        static DangKyPhuEntities entities =new DangKyPhuEntities();
        #endregion

        #region constructor
        public MonHocTuongDuongRepository()
        {
            //entities = new DangKyPhuEntities();
        }
        #endregion

        public static IQueryable<Entities.MonHocTuongDuong> LayMonHocTuongDuong(string monHocID)
        {
            return (from m in entities.MonHocTuongDuongs
                        where m.MonHocID.Equals(monHocID)
                        select m);
        }

        public bool KiemTraMonHocTuongDuong(string monHocID)
        {
            var result = from m in entities.MonHocTuongDuongs
                         where m.MonHocID.Equals(monHocID)
                         select m;
            if (result.Count() > 0)
                return true;
            return false;
        }
    }
}
